<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="${pageContext.request.contextPath}/queryServlet" method="post">
		<table align="center">
			<caption>查询用户权限</caption>
			<tr>
				<td>
			  	用户名<input type="text" name="username" placeholder="输入用户名" value="${requestScope.username}">
				</td>
			</tr>
			<tr>
				<td align="center">
			 <input type="submit">
				</td>
			</tr>
		</table>	
	</form>
	
	<c:if test="${requestScope.authority!=null}">
	<form action="${pageContext.request.contextPath}/updateServlet" method="post">
		<input type="hidden" name="username" value="${requestScope.username}">
		<table align="center">
		<tr>
			<c:if test="${requestScope.authority.article1}">
				<td><input type="checkbox"  checked="checked" name="aut" value="a1">article1</td>
			</c:if>
			<c:if test="${!requestScope.authority.article1}">
				<td><input type="checkbox" name="aut" value="a1" >article1</td>
			</c:if>
		</tr>
		<tr>
			<c:if test="${requestScope.authority.article2}">
				<td><input type="checkbox"  checked="checked" name="aut" value="a2">article2</td>
			</c:if>
			<c:if test="${!requestScope.authority.article2}">
				<td><input type="checkbox" name="aut" value="a2" >article2</td>
			</c:if>
		</tr>
		<tr>
			<c:if test="${requestScope.authority.article3}">
				<td><input type="checkbox" checked="checked" name="aut" value="a3">article3</td>
			</c:if>
			<c:if test="${!requestScope.authority.article3}">
				<td><input type="checkbox"  name="aut" value="a3">article3</td>
			</c:if>
		</tr>
		<tr>
			<c:if test="${requestScope.authority.article4}">
				<td><input type="checkbox"  checked="checked" name="aut" value="a4">article4</td>
			</c:if>
			<c:if test="${!requestScope.authority.article4}">
				<td><input type="checkbox" name="aut" value="a4" >article4</td>
			</c:if>
		</tr>
		<tr>
			<td><input type="submit" value="修改"></td>
		</tr>
		</table>
	</form>
	</c:if>

</body>
</html>